﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TransferCommon
{
    [Serializable]
    public class UpLoadInfo
    {
        /// <summary>
        /// 上传文件名称
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        public long FileSize { get; set; }
        /// <summary>
        /// 保存名称
        /// </summary>
        public string SaveName { get; set; }
        /// <summary>
        /// 上传开始位置
        /// </summary>
        public long TransferPos { get; set; }
        /// <summary>
        /// 上传文件长度（大小）
        /// </summary>
        public long TransferLength { get; set; }
        public UpLoadInfo(string _FileName, long _FileSize, long _TransferPos = 0L, long _TransferLength = 0L, string _saveName = "")
        {
            if (string.IsNullOrWhiteSpace(_saveName))
                _saveName = System.IO.Path.GetFileName(_FileName);
            if (_TransferLength == 0)
                _TransferLength = _FileSize;
            this.FileName = _FileName;
            this.FileSize = _FileSize;
            this.TransferPos = _TransferPos;
            this.TransferLength = _TransferLength;
            this.SaveName = _saveName;
        }
    }
}
